From 39546603547d2781e9ff02e67ad6b529133f1c71 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 Feb 2004 13:41:04 +0000 Subject: [PATCH] (ffap-file-at-point): Try parent directories. --- lisp/ffap.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/ffap.el b/lisp/ffap.el index 668700a5c1f..27abd52f563 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1185,6 +1185,14 @@ which may actually result in an url rather than a filename." remote-dir (substring name (match-end 1))))) (ffap-file-exists-string (ffap-replace-file-component remote-dir name)))))) + ;; Try all parent directories by deleting the trailing directory + ;; name until existing directory is found or name stops changing + ((let ((dir name)) + (while (and dir + (not (ffap-file-exists-string dir)) + (not (equal dir (setq dir (file-name-directory + (directory-file-name dir))))))) + (ffap-file-exists-string dir))) ) (set-match-data data)))) -- 2.30.2